import { requestAjax } from './http'

export interface DemoVO {
  _id: string
  name: string
  nickname: string
  code: string
  amount: number | null
  commenceDate: string
  describe: string
}

export function getPubAdminDemoListPage(params?: any) {
  // return requestAjax({
  //   url: `/api/pub/admin/demo/list/page/${params.pageSize}/${params.currentPage}`,
  //   method: 'get',
  //   params
  // })
  console.log(params);
  const res = {
    "code": 200,
    "status": 200,
    "data": [
      {
        "_id": "68b5df688c329572c5e3a98f",
        "name": "王五",
        "code": "cvbfdg",
        "amount": 234,
        "commenceDate": "2021-07-07T16:00:00.000Z",
        "describe": "测试数据 111",
        "createTime": "2025-09-01T18:01:12.596Z",
        "updateTime": "2025-09-02T01:14:37.112Z",
        "createBy": "",
        "updateBy": "test1",
        "nickname": ""
      },
      {
        "_id": "68b5df688c329572c5e3a98b",
        "name": "小红",
        "code": "dfgfdg",
        "amount": "456456",
        "commenceDate": "2023-01-05",
        "describe": "试数据 1ftghy",
        "createTime": "2025-09-01T18:01:12.596Z",
        "updateTime": "2025-09-01T18:01:12.596Z",
        "createBy": "",
        "updateBy": ""
      },
      {
        "_id": "68b5df688c329572c5e3a98e",
        "name": "小牛",
        "code": "dsfxzc",
        "amount": "456",
        "commenceDate": "2022-12-15",
        "describe": "",
        "createTime": "2025-09-01T18:01:12.596Z",
        "updateTime": "2025-09-01T18:01:12.596Z",
        "createBy": "",
        "updateBy": ""
      },
      {
        "_id": "68b5df688c329572c5e3a990",
        "name": "二牛",
        "code": "sdfrt",
        "amount": "456",
        "commenceDate": "2022-12-15",
        "describe": "",
        "createTime": "2025-09-01T18:01:12.596Z",
        "updateTime": "2025-09-01T18:01:12.596Z",
        "createBy": "",
        "updateBy": ""
      },
      {
        "_id": "68b5df688c329572c5e3a98a",
        "name": "王老五",
        "code": "rtfd",
        "amount": "45645467",
        "commenceDate": "20241-09-06",
        "describe": "",
        "createTime": "2025-09-01T18:01:12.596Z",
        "updateTime": "2025-09-01T18:01:12.596Z",
        "createBy": "",
        "updateBy": ""
      },
      {
        "_id": "68b5df688c329572c5e3a98c",
        "name": "大大",
        "code": "trytryfg",
        "amount": "6576",
        "commenceDate": "2024-09-01",
        "describe": "",
        "createTime": "2025-09-01T18:01:12.596Z",
        "updateTime": "2025-09-01T18:01:12.596Z",
        "createBy": "",
        "updateBy": ""
      },
      {
        "_id": "68b5df688c329572c5e3a988",
        "name": "小明",
        "code": "assxsd",
        "amount": "6785",
        "commenceDate": "",
        "describe": "试数据 1546",
        "createTime": "2025-09-01T18:01:12.596Z",
        "updateTime": "2025-09-01T18:01:12.596Z",
        "createBy": "",
        "updateBy": ""
      },
      {
        "_id": "68b5df688c329572c5e3a987",
        "name": "张三",
        "code": "iokjh",
        "amount": "3546",
        "commenceDate": "2024-04-04",
        "describe": "",
        "createTime": "2025-09-01T18:01:12.596Z",
        "updateTime": "2025-09-01T18:01:12.596Z",
        "createBy": "",
        "updateBy": ""
      },
      {
        "_id": "68b5df688c329572c5e3a989",
        "name": "李四",
        "code": "qew",
        "amount": "4564567",
        "commenceDate": "2024-10-01",
        "describe": "",
        "createTime": "2025-09-01T18:01:12.596Z",
        "updateTime": "2025-09-01T18:01:12.596Z",
        "createBy": "",
        "updateBy": ""
      },
      {
        "_id": "68b5df688c329572c5e3a98d",
        "name": "666",
        "code": "fdgy",
        "amount": "",
        "commenceDate": "",
        "describe": "2019-10-26",
        "createTime": "2025-09-01T18:01:12.596Z",
        "updateTime": "2025-09-01T18:01:12.596Z",
        "createBy": "",
        "updateBy": ""
      }
    ],
    "msg": "",
    "page": {
      "pageSize": 10,
      "currentPage": 1,
      "total": 25
    }
  };
  return Promise.resolve(res);
}

export function getPubAdminDemoDetail(params?: any) {
  console.log(params);
  const res = {
    "code": 200,
    "status": 200,
    "data": {
      "_id": "68b5df688c329572c5e3a98f",
      "name": "王五",
      "code": "cvbfdg",
      "amount": 234,
      "commenceDate": "2021-07-07T16:00:00.000Z",
      "describe": "测试数据 111",
      "createTime": "2025-09-01T18:01:12.596Z",
      "updateTime": "2025-09-02T01:14:37.112Z",
      "createBy": "",
      "updateBy": "test1",
      "nickname": ""
    },
    "msg": ""
  };
  return Promise.resolve(res);
}

export function postPubAdminDemoSaveInfo(data?: any) {
  return requestAjax({
    url: '/api/pub/admin/demo/save/info',
    method: 'post',
    data
  })
}

export function postPubAdminDemoSaveBatch(data?: any) {
  return requestAjax({
    url: '/api/pub/admin/demo/save/batch',
    method: 'post',
    data
  })
}

export function deletePubAdminDemoDelete(data?: any) {
  return requestAjax({
    url: '/api/pub/admin/demo/delete',
    method: 'delete',
    data
  })
}
